-
Notifications
You must be signed in to change notification settings - Fork 415
Same chain multichain deposits and withdrawals FEDEV-3201 #2135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added AVALANCHE_FUJI to settlement and source chain IDs. - Enhanced source chain validation in various components to include the current chain context. - Updated multichain token mappings and added new functions for gas estimation on same-chain transactions. - Refactored related components to ensure proper handling of source and settlement chains. - Cleaned up unused imports and improved code readability across multiple files.
Deploying gmx-interface-home with
|
| Latest commit: |
127dbf5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cf5f9589.gmx-interface-home.pages.dev |
| Branch Preview URL: | https://same-chain-multichain.gmx-interface-home.pages.dev |
Deploying gmx-interface with
|
| Latest commit: |
127dbf5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://29ae2cf2.gmx-interface.pages.dev |
| Branch Preview URL: | https://same-chain-multichain.gmx-interface.pages.dev |
…nd improve source chain handling - Changed the estimated time text from Instantly to Instant in DepositView and WithdrawalView components. - Enhanced source chain logic in TransferDetailsView to ensure accurate chain identification for transactions. - Updated localization files to reflect the change in text for multiple languages.
…bling functionality - Added support for disabling dropdown items in DropdownSelector based on custom logic, including tooltip messages for disabled items. - Introduced a new sorting function for token data in WithdrawalView to improve the display of transferable tokens. - Updated localization files to include messages for unsupported withdrawal scenarios across multiple languages.
…lity - Introduced multichain funding tracking by adding to manage pending transactions. - Updated DepositView and WithdrawalView to handle multichain deposit and withdrawal events, including logging and toast notifications for transaction success and failure. - Refactored token balance handling in SelectAssetToDepositView to use instead of . - Improved transaction receipt handling to capture bridge events and update pending funding states accordingly.
0f04d77 to
404f3f2
Compare
404f3f2 to
9a51810
Compare
|
@cursor review |
|
|
||
| const filteredBalances: DisplayTokenChainData[] = useMemo(() => { | ||
| return tokenChainDataArray | ||
| const multichainTokens = tokenChainDataArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract this code to some pure function? maybe even two and then compose them
getMultichainTokens
getSettlementChainTokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return isFirstWithdrawal; | ||
| }; | ||
|
|
||
| function tokenDataSorter(a: TokenData, b: TokenData): 1 | -1 | 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add byBalance to name and move it to some tokens utils file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ); | ||
| return mappedTokenId !== undefined; | ||
| }); | ||
| return networks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create getActiveNetworks or something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
||
| return ( | ||
| MULTI_CHAIN_WITHDRAWAL_TRADE_TOKENS[chainId as SettlementChainId] | ||
| const multichainTokens = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be moved to function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
| ); | ||
|
|
||
| const sameChainNetworkFee = useMemo((): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| await sendWalletTransaction({ | ||
| chainId, | ||
| to: getContract(chainId, "MultichainTransferRouter"), | ||
| await sendSameChainWithdrawalTxn({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks really big can we extract that to hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted to useWithdrawViewTransactions and inside handleSameChainWithdraw and handleMultichainWithdraw
…iews - Introduced calculateNetworkFeeDetails function to encapsulate network fee calculations based on gas limit and price. - Refactored DepositView to utilize the new fee calculation function, improving readability and maintainability. - Updated WithdrawalView to replace inline fee calculations with the new utility function. - Enhanced token sorting and filtering logic in SelectAssetToDepositView for better performance and clarity. - Adjusted indexer URLs and multichain configurations for consistency across environments.
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no bugs!
|
@cursor review |
No description provided.